<?php 

$sql = "SELECT
                     p.cover,
					 p.video,
                     d.title,
					 d.description,
					 d.meta_key,
			 		 d.meta_description
                FROM
                    projects AS p,
                    project_description AS d
                WHERE
                	p.project_id = d.project_id
                    
                    AND
                    
                    d.lang_id = '".$_SESSION['lang_id']."'
                    
                    AND
                    
					p.published
					
					AND p.project_id = '".$sef_url."'
                    
                  ";

$result = query($sql);
$row = mysql_fetch_object($result);

head(sth($row->title),sth($row->meta_description),'','collections');



$sql_c = "SELECT
                     c.sef_url AS class,
					 d.Name,
                     s.sef_url
                FROM
                    category AS c,
                    category_description AS d,
					sef_url AS s
					
                WHERE
                	c.category_id = d.category_id
                    
                    AND
                    
                    d.lang_id = '".$_SESSION['lang_id']."'
                    
                    AND
                    
					c.published
					
					AND c.category_id = (SELECT category_id FROM project_to_category WHERE project_id = '".$sef_url."' LIMIT 1)
					
					AND  s.tamplate = 'collcategory'
					
					AND s.query = c.category_id
					
					AND s.lang_id = '".$_SESSION['lang_id']."'
                    
                  ";

$result_c = query($sql_c);
$rcat = mysql_fetch_object($result_c);


?>
    <section id="content" class="cf">
        
        <div class="gr1 left table-display">
            <a href="<?=HTML_BASE.$_SESSION['lang']?>/collections/<?=$rcat->sef_url?>" class="<?=$rcat->class?>">
                <span><?=$rcat->Name?></span>
            </a>
        </div>
        
      
        <div class="gr3 right">
            <ul id="slider">
            <li>
                <a href="<?=HTML_BASE?>project_images/big/<?=$row->cover?>" data-src="<?=HTML_BASE?>project_images/big/<?=$row->cover?>" class="gallery-item">
                    <img src="<?=HTML_BASE?>project_images/big/<?=$row->cover?>" alt="<?=$row->title?>" title="<?=$row->title?>"/>
                </a>
            </li>
       
            
            	<?php 
			
			$sql = "SELECT
					g.file,
					d.description
				  FROM
					project_gallery AS g,
					project_gallery_description AS d
				  
				  WHERE g.project_id = '".$sef_url."'
					
					AND g.id = d.image_id
					
					AND d.lang_id = '".$_SESSION['lang_id']."'
					
					ORDER BY g.order_number DESC 
				  
					";
				
			$result = query($sql);
			
			while ($rowg = mysql_fetch_object($result)) {

				
            ?>
            <li>
                <a href="<?=HTML_BASE?>project_images/gallery/<?=$rowg->file?>" data-src="<?=HTML_BASE?>project_images/gallery/<?=$rowg->file?>" class="gallery-item" >
                    <img src="<?=HTML_BASE?>project_images/gallery/<?=$rowg->file?>" alt="<?=$rowg->description?>" title="<?=$rowg->description?>"/>
                </a>
            </li>
            <?php } ?>
            
            </ul>
       
        </div>
        
        
        <div class="gr1 left">
            <h1><?=$row->title?></h1>
            <?=$row->description?>
        </div>
        
    </section>



		
		
<?php
foot();
?>